home *** CD-ROM | disk | FTP | other *** search
- #define NULL 0L
- #define ETX 3
- #define DEL 8
- #define CR 13
-
- #define pasStrLen 256
- #define numStrLen 14
- #define buttonDelay 8L /* ticks to hold down a keyboard-activated button. */
- #define waitTime 4L /* ticks to give multifinder when nothing is going on. */
- #define longMask 0xfffc
- #define wordMask 0xfffe
- #define deactiveMask 0xfffe
- #define maxCopyBits 3072
-
- #define forceStop 1 /* flags for stopData - dontForceStop allows the */
- #define dontForceStop 0 /* current copy to complete later, not now. */
-
- #define dataWind 128
-
- #define resumeFlag 1
- #define clipFlag 2
- #define srEvt 1
- #define mmEvt 0xfa
-
- #define nothingElseToDo 4
- #define someElseToDo 3
- #define lotsElseToDo 2
-
- #define noGray 0
- #define someGray 1
- #define allGray 2
-
- #define maxDataPlanes 2
- #define defaultDataWidth 129
- #define defaultDataHeight 129
-
- /* str# resource numbers and names for the strings in them */
-
- #define statStrings 128
- #define genStr 1
-
- #define windTitles 129
- #define newWindTitle 1
-
- #define fontNames 130 /* strings containing *names* of fonts used. */
- #define fontSizeStrs 131 /* sizes corresponding to the above. */
- #define statFont 1
-
- #define panicStrs 132
- #define diskPanic 1
- #define rsrcPanic 2
- #define memPanic 3
- #define scrapPanic 4
-
- /* constants designed to make 9pt Geneva look good */
-
- #define minFontSize 9
- #define leftMargin 3
- #define topMargin 2
- #define scrollSize 16
- #define scrollSpace 15
-
- #define min(x,y) ((x)<(y)?(x):(y))
- #define max(x,y) ((x)>(y)?(x):(y))
- #define delta(x,y) ((x)>(y)?(x)-(y):(y)-(x))
-
- typedef struct dataFontInfo {
- int number; /* font number - converted to name for save. */
- int size;
- int topSpace;
- int topStart;
- int genStart;
- } dataFontInfo, *dataFontPtr, **dataFontHandle;
-
- typedef struct dataState {
- struct dataState **next, **prev; /* maintain a doubly-linked list of dataStates. */
- WindowPtr parent; /* sometimes we only have the dataHandle. */
- BitMap offBits; /* off-screen bitmap, used with any of bases */
- char *bases[maxDataPlanes]; /* current and next planes of data. */
- Rect dataRect; /* active rectangle within the portRect */
- long planeSize; /* total amount of memory in each plane */
- long changed; /* tickcount at time of last change to the data */
- long generation; /* total count of changes to the system */
- int planes; /* number of planes in actual use. */
- int partDone; /* status of generating the next state. */
- int state; /* dataStopped, dataStepping, or dataRunning */
- int flags; /* whether there is a statline, etc. */
- struct dataFontInfo theFont; /* describes font used for generation counter. */
-
- #define dataStopped 0
- #define dataStepping 1
- #define dataRunning 2
-
- #define dataStatLine 1
-
- BitMap allBits; /* off-screen, just the size of the window. */
- long lastGeneration; /* last generation # that was actually drawn. */
- int lastGenWidth; /* pixel width of the last generation # drawn. */
- int allBitsState; /* validity of the bitmap used to compose. */
-
- #define bitsBadData 1
- #define bitsBadSel 2
- #define bitsBadFrame 4
- #define bitsBadGen 8
- #define bitsBadAnts 16
-
- BitMap selBits; /* bounds are selection bounds, has data in it. */
- RgnHandle selRgn; /* the region of the selection within selBits. */
- long antTick; /* which tick the ants last changed on. */
- int isSelect; /* whether there is currently a selection. */
- int selActive; /* whether it is crawling or not... */
- int antSkew; /* which ant pattern this window is on. */
-
- Handle cycleBase; /* used to detect cycles - a copy of one state. */
- long cycleGeneration; /* generation of the cycleBase bits. */
- long cycleLength; /* length of the cycles being detected. */
- long cycleFitLength; /* used to figure out the minimal cycle length. */
- int cycleFlags; /* current cycle detection mode. */
-
- #define cycleNone 0
- #define cycleRestart 1
- #define cycleDetect 2
-
- BitMap undoSelBits;
- RgnHandle undoSelRgn;
- long undoGeneration; /* generation of the other plane. */
- int undoFlags; /* what sort of undo-able action there is. */
-
- #define undoNone 0
- #define undoData 1
- #define undoSelect 2
-
- } dataState, *dataPtr, **dataHandle;
-